Skip to content

host: tighten venue-registry install seam and mutex discipline - #534

Merged
mfw78 merged 2 commits into
dev/m1from
docs/507-venue-registry-install-discipline
Jul 23, 2026
Merged

host: tighten venue-registry install seam and mutex discipline#534
mfw78 merged 2 commits into
dev/m1from
docs/507-venue-registry-install-discipline

Conversation

@mfw78

@mfw78 mfw78 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What

Tighten the VenueRegistry::install seam in crates/videre-host/src/registry.rs on two fronts.

Document the mutex discipline: install takes the adapter-map mutex only for the synchronous insert and never holds it across an await.

Narrow visibility from pub to pub(crate), recording the boot-only invariant that adapters install at provider boot and never post-boot through a shared handle clone.

Add a #[cfg(feature = "test-utils")] pub fn install_for_test shim that forwards to install, so out-of-crate tests install a mock adapter without the provider boot path.

A new test-utils feature gates the shim, and a self dev-dependency on videre-host with that feature turns it on for this crate's own test targets so cargo test -p videre-host sees install_for_test without every invocation passing --features test-utils.

The lone out-of-crate caller, scripted_registry in tests/platform.rs, now installs via install_for_test.

Why

install was public but only ever legitimately called at provider boot, so an external caller could install an adapter post-boot through a cloned handle and silently break the boot-only invariant.

Making it pub(crate) closes that seam while the feature-gated install_for_test keeps the direct install available to tests, and the mutex-discipline note documents the no-await-under-lock contract for future editors.

Testing

All commands run from the worktree root inside nix develop --command, against the shared warm target dir, scoped to the touched crate videre-host.

cargo fmt --all -- --check clean, no diff.

cargo clean -p videre-host then cargo clippy -p videre-host --all-targets --all-features -- -D warnings clean rebuild with zero warnings across lib, tests and examples.

cargo test -p videre-host --all-features passed: 47 unit, 14 platform.rs, 2 zero_leak, 0 failed. This covers the reworked seam, with scripted_registry installing via the feature-gated install_for_test and the boot-path pub(crate) install still exercised by the e2e tests.

AI Assistance

Implemented, reviewed and verified with Claude Code (Opus).

Closes #507

@mfw78
mfw78 force-pushed the docs/507-venue-registry-install-discipline branch from 6827750 to 5eea4b9 Compare July 23, 2026 14:15
@mfw78
mfw78 changed the base branch from feat/m5-pre-carve-runbook to dev/m1 July 23, 2026 14:15
Install is boot-time only; drop it off the shared public handle so a
post-boot clone cannot register with no compiler signal. Out-of-crate
tests reach a mock adapter through the test-utils install_for_test seam.
@mfw78
mfw78 force-pushed the docs/507-venue-registry-install-discipline branch from 5eea4b9 to dd71a37 Compare July 23, 2026 14:52
@mfw78
mfw78 merged commit 7cff3d4 into dev/m1 Jul 23, 2026
7 checks passed
@mfw78
mfw78 deleted the docs/507-venue-registry-install-discipline branch July 23, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant